package cn.fzm.service;

import cn.fzm.dao.OrderDao;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Dremeue
 * @create 2019-09-27 11:15
 **/
@Transactional
public class OrderService {

    private OrderDao orderDao;

    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    public void changeMoney() {
        orderDao.lessMoney();

        // 手动增加异常,导致转账失败
        // int i = 1 / 0;

        orderDao.moreMoney();
    }
}
